package chapter12;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.logging.Logger;

public class LoggingException extends Exception{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static Logger logger=Logger.getLogger("LoggingException");
	public LoggingException()
	{
		StringWriter writer=new StringWriter();
		printStackTrace(new PrintWriter(writer));
		logger.severe(writer.toString());
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try
		{
			throw new LoggingException();
		}catch(LoggingException l)
		{
			System.out.println(l.getLocalizedMessage());
		}

	}

}
